
#pragma  once

#include "dmObject.h"

typedef HMODULE dmLibHandle;

class DMDB_BASE_API dmDynamicLoader : public dmObject
{
public:
  static dmDynamicLoader* New();
  dmTypeMacro(dmDynamicLoader,dmObject);

  static dmLibHandle OpenLibrary(const char*);

  static int CloseLibrary(dmLibHandle);

  typedef void (*SymbolPointer)();

  static void* GetSymbolAddress(dmLibHandle, const char*);

  static const char* LibPrefix();

  static const char* LibExtension();
  static void SetLibExtension(const char* ext);

  static const char* LastError();

protected:
  dmDynamicLoader() {};
  ~dmDynamicLoader() {};

private:
  dmDynamicLoader(const dmDynamicLoader&);  // Not implemented.
  void operator=(const dmDynamicLoader&);  // Not implemented.
};

